#! /bin/bash

total=24;
a=4;
b=10;

for exe in 3d-gs-7p
do
    rm result/$exe.txt 
    for index in `seq $a $b`;
    do 
    nx=$((2 ** $index))
    t=$((2 ** ($total - $a - ($index - $a) * 3)))
    ../$exe/exe-$exe $nx $nx $nx $t >> result/$exe.txt 
    done
done

echo -e "size\tscalar\tour\tspeedup" > result/$exe.data.txt
cat result/3d-gs-7p.txt|tr "," "=" | awk -F "= " '{print $3 "\t" $NF}'| paste - - |awk '{print $1"\t" $2"\t" $4"\t"$4/$2}' >> result/$exe.data.txt


